import QtQuick 1.0
import "js/TreeUtil.js" as TreeUtil

Rectangle {
    id: treeView
    width: 100
    height: 62
    color: "#00000000"

    property int nodeSize: 6

    function addNode(father, num)
    {
        var nodeobj = TreeUtil.createNode(this, father, nodeSize);

        if ( nodeobj !== false )
        {
            //nodeobj.x = nodeobj.parent.width / 2 - nodeobj.width / 2;
            //nodeobj.y = 0;
            nodeobj.x = (nodeobj.parent.width - nodeobj.width) * Math.random();
            nodeobj.y = (nodeobj.parent.height - nodeobj.height) * Math.random();
        }
        else
            console.log("[TreeView.qml] node not created!");

        return nodeobj;
    }
}
